import {defineStore} from 'pinia'
export const count = defineStore('count',{
    state:()=>{
        return{
            countNum:0,
            info:'明天就开始放假，高兴不！！'
        }
    },
    getters:{
        oddOrEven(state){
            return state.countNum % 2 ==1 ?"奇数":"偶数"
        }
    },
    actions:{
        add(val){
            this.countNum += val
        }
    },
    // 开启持久化保存数据
    persist:{
        enabled:true,
        strategies:[
            {
                key:'zhuangzhuang',
                storage:localStorage,
                // paths:[]
            }
        ]
    }
})